
function swalToastr(title, text, type, func, butName1, butName2) {
    if (!butName1 || butName1 == '') {
        butName1 = '确定';
    }
    if (!butName2 || butName2 == '') {
        butName2 = '取消';
    }
    swal({
        title: title,
        text: text,
        showConfirmButton:"true",
        showCancelButton:"true",
        confirmButtonText:butName1,
        cancelButtonText:butName2,
        animation:"slide-from-top"
    }, function() {
        func();
    });
}

function swalInfoToastr(title, text) {
    swal({
        title: title,
        text: text,
        showConfirmButton:"true",
        confirmButtonText:"确定",
        animation:"slide-from-top"
    }, function() {
        return true;
    });
}

function swalErrorToastr(title, text) {
    swal({
        title: title,
        text: text,
        type: 'warning',
        showConfirmButton:"true",
        confirmButtonText:"确定",
        animation:"slide-from-top"
    }, function() {
        return true;
    });
}

function swalClosePageToastr(func) {
    swal({
        title: '提示',
        text: common_no_save_msg,
        showCancelButton:"true",
        showConfirmButton:"true",
        confirmButtonText:"确定",
        cancelButtonText:"取消",
        animation:"slide-from-top"
    }, function() {
        func();
    });
}